package io.github.bloquesoft.entity.clazz;

import com.sun.org.apache.xpath.internal.operations.Bool;
import io.github.bloquesoft.entity.definition.PojoPropertyDefinition;
import io.github.bloquesoft.entity.definition.PropertyType;

import java.lang.reflect.Field;
import java.util.Date;

public class ClassPojoPropertyDefinition extends AbstractClassPropertyDefinition implements PojoPropertyDefinition {

    private final static Class<?>[] TYPES = new Class[] {
         int.class,  long.class, double.class, float.class, String.class, Integer.class, Long.class, Float.class, Double.class, Boolean.class, Date.class
    };

    public static boolean isPojoPropertyType(Class<?> clazz)
    {
        for(Class<?> c : TYPES) {
            if(c.equals(clazz)) {
                return true;
            }
        }
        return false;
    }

    private Boolean isParentId;

    public ClassPojoPropertyDefinition(Field field) {
        super(field, PropertyType.Pojo);
        this.isParentId = false;
    }

    @Override
    public Boolean isParentId() {
        return this.isParentId;
    }

    public void setIsParentId(Boolean isParentId){
        this.isParentId = isParentId;
    }


}
